﻿namespace RndMaterialDisposalService.Models.RequestModel
{
    public class OutsourcingProcessingElectronFlowReq
    {
        //1.控制
        public ControlModel? control { get; set; } = new ControlModel();
        //2.计划审核
        public OutsourcingProcessingTask1Model? task1 { get; set; } = new OutsourcingProcessingTask1Model();
        //3.外协加工
        public OutsourcingProcessingTask3Model? task3 { get; set; } = new OutsourcingProcessingTask3Model();
        //3.1.不良品分析
        public OutsourcingProcessingTask6Model? task6 { get; set; } = new OutsourcingProcessingTask6Model();
        //4.外协回货
        public OutsourcingProcessingTask4Model? task4 { get; set; } = new OutsourcingProcessingTask4Model();
        //5.半成品入库
        public OutsourcingProcessingTask5Model? task5 { get; set; } = new OutsourcingProcessingTask5Model();

        //上传附件
        public List<Attachment> UploadFiles { get; set; } = new List<Attachment>();
        public FormHeader formHeader { get; set; } = new FormHeader();
        //不良品记录列表
        public List<RecordOfDefectiveProducts> recordOfDefectiveProductsInfo { get; set; } = new List<RecordOfDefectiveProducts>();
    }

    /// <summary>
    /// 1.控制
    /// </summary>
    public class ControlModel 
    {
        //加工类型
        public string? ProcessingType { get; set; }
        //原物料编码
        public string? RawMaterialCode { get; set; }
        //原产品型号
        public string? RawProductType { get; set; }
        //原生产厂家
        public string? RawManufacturer { get; set; }
        //新物料编码
        public string? NewMaterialCode { get; set; }
        //新产品型号
        public string? NewProductType { get; set; }
        //新生产厂家
        public string? NewManufacturer { get; set; }
        //单板/机柜编码
        public string? TrialBoardCabinetCode { get; set; }
        //单板/机柜型号
        public string? SingleBoardCabinetType { get; set; }
        //试用成品数量
        public string? TrialFinishedProductCount { get; set; }
        //试用物料存放位置
        public string? ProbationMaterialsPosition { get; set; }
        //元件位置
        public string? ElementPositioning { get; set; }
        //加工地点
        public string? ProcessingLocation { get; set; }
        //OEM
        public bool? Oem { get; set; }
        //试制物料备料方
        public string? MaterialPreparationParty { get; set; }
        //试用加工过程重点关注事项
        public string? KeyConcerns { get; set; }
        //指定产品线
        public string? ProductLine { get; set; }
        //计划员-责任人员
        public string? ResponsibilityPlanner1 { get; set; }
        //计划员-责任人员ID
        public string? ResponsibilityPlanner1Id { get; set; }
        //计划员-责任内容
        public string? ResponsibilityComment1 { get; set; }
        //库房人员-责任人员
        public string? ResponsibilityPlanner2 { get; set; }
        //库房人员-责任人员ID
        public string? ResponsibilityPlanner2Id { get; set; }
        //库房人员-责任内容
        public string? ResponsibilityComment2 { get; set; }
        //外协SQE-责任人员
        public string? ResponsibilityPlanner3 { get; set; }
        //外协SQE-责任人员ID
        public string? ResponsibilityPlanner3Id { get; set; }
        //外协SQE-责任内容
        public string? ResponsibilityComment3 { get; set; }
        //外协回货物控员-责任人员
        public string? ResponsibilityPlanner4 { get; set; }
        //外协回货物控员-责任人员ID
        public string? ResponsibilityPlanner4Id { get; set; }
        //外协回货物控员-责任内容
        public string? ResponsibilityComment4 { get; set; }
        //入库员-责任人员
        public string? ResponsibilityPlanner5 { get; set; }
        //入库员-责任人员ID
        public string? ResponsibilityPlanner5Id { get; set; }
        //入库员-责任内容
        public string? ResponsibilityComment5 { get; set; }
        //抄送
        public string? CCUser { get; set; }
        //抄送ID
        public string? CCUserId { get; set; }
        //备注
        public string? Comment { get; set; }
        //父流程实例号
        public string? FatherProcInstId { get; set; }
    }

    /// <summary>
    /// 2.计划审核
    /// </summary>
    public class OutsourcingProcessingTask1Model
    {
        //审核结论
        public string? Approval { get; set; }
        //任务令/PO号
        public string? TaskOrderPO { get; set; }
        //任务令数量
        public string? TaskOrderCount { get; set; }
        //产品编码
        public string? ProductCode { get; set; }
        //物料是否齐套
        public bool? IsMaterialKitting { get; set; }
        //物料采购明细
        public List<MaterialProcurementDetails> MaterialProcurementInfo { get; set; } = new List<MaterialProcurementDetails>();
        //说明
        public string? Comment { get; set; }
    }

    /// <summary>
    /// 3.外协加工
    /// </summary>
    public class OutsourcingProcessingTask3Model 
    {
        //审核结论
        public string? Approval { get; set; }
        //产品编码
        public string? ProductCode { get; set; }
        //本次加工数量
        //public string? ThisProcessingCount { get; set; }
        //累计加工数量
        //public string? AccumulatedProcessingCount { get; set; }
        //是否完成
        //public bool? IsComplete { get; set; }
        //外协加工数量
        public string? OutsourcingProcessingCount { get; set; }
        //不合格数量
        public string? UnqualifiedCount { get; set; }
        //是否与试制物料有关
        public bool? IsTrialProductionMaterialsApply { get; set; }
        //分析附件
        public string? AnalyzeAttachments { get; set; }
        //序号
        public string? SerialNumber { get; set; }
        //不良品条码
        public string? DefectiveProductsCode { get; set; }
        //故障描述
        public string? FaultDescription { get; set; }
        //分析责任人
        public string? AnalysisResponsiblePerson { get; set; }
        //分析责任人ID
        public string? AnalysisResponsiblePersonId { get; set; }
    }

    /// <summary>
    /// 3.1.不良品分析
    /// </summary>
    public class OutsourcingProcessingTask6Model 
    {
        //序号
        public string? SerialNumber { get; set; }
        //不良品条码
        public string? DefectiveProductsCode { get; set; }
        //故障描述
        public string? FaultDescription { get; set; }
        //分析责任人
        public string? AnalysisResponsiblePerson { get; set; }
        //分析责任人ID
        public string? AnalysisResponsiblePersonId { get; set; }
        //原因分析
        public string? AnalyzeAttachments { get; set; }
        //是否与试用物料有关
        public bool? IsTrialProductionMaterialsApply { get; set; }
    }

    /// <summary>
    /// 4.外协回货
    /// </summary>
    public class OutsourcingProcessingTask4Model 
    {
        //产品编码
        public string? ProductCode { get; set; }
        //回货数量
        public string? ReturnQuantity { get; set; }
        //本次回货数量
        //public string? ThisReturnCount { get; set; }
        //累计回货数量
        //public string? AccumulatedReturnsCount { get; set; }
        //是否完成
        //public bool? IsComplete { get; set; }
        //说明
        public string? Comment { get; set; }
    }

    /// <summary>
    /// 5.半成品入库
    /// </summary>
    public class OutsourcingProcessingTask5Model
    {
        //审核结论
        public string? Approval { get; set; }
        //产品编码
        public string? ProductCode { get; set; }
        //入库数量
        public string? ReceiptQuantity { get; set; }
        //本次入库数量
        //public string? ThisWarehousingCount { get; set; }
        //累计入库数量
        //public string? AccumulatedReceiptCount { get; set; }
        //是否完成
        //public bool? IsComplete { get; set; }
        //说明
        public string? Comment { get; set; }
    }

    /// <summary>
    /// 物料采购明细
    /// </summary>
    public class MaterialProcurementDetails 
    {
        public int? key { get; set; }
        public string? materialCode { get; set; }
        public string? count { get; set; }
        public DateTime? arrivalTime { get; set; }
        public string? procurementPersonnel { get; set; }
        public string? procurementPersonnelID { get; set; }
    }

    /// <summary>
    /// 不良品记录
    /// </summary>
    public class RecordOfDefectiveProducts 
    {
        public int? key { get; set; }
        //不良品条码
        public string? defectiveProductsCode { get; set; }
        //故障描述
        public string? faultDescription { get; set; }
        //分析责任人
        public string? analysisResponsiblePerson { get; set; }
        //提交时间
        public DateTime? submissionTime { get; set; }
        //原因分析
        public string? causeAnalysis { get; set; }
        //是否与试用物料有关
        public string? isTrialMaterialsRelated { get; set; }
        //签字时间
        public DateTime? signingTime { get; set; }
    }

    public class TheMainFlowFormDataModel 
    {
        //1.试用申请
        public TrialApplicationModel? trialApplication { get; set; } = new TrialApplicationModel();
        //试用范围-确定稿
        public List<TrackMaterialTrackingDetails> determineTrackMaterialTracking { get; set; } = new List<TrackMaterialTrackingDetails>();
        //物料跟踪明细
        public List<MaterialTrackingDetails> materialTrackingDetailsList { get; set; } = new List<MaterialTrackingDetails>();
    }

    /// <summary>
    /// 查询条件
    /// </summary>
    public class OutsourcingProcessingReportConditionModel
    {
        //父流程实例
        public string? FatherProcInstId { get; set; }
        //单号
        public string? OutApplicationNumber { get; set; }
        //申请时间
        public string? OutApplicantTime { get; set; }
        //申请人
        public string? OutSubmitBy { get; set; }
        //流程状态
        public string? OutCurrentStatus { get; set; }

        public int pageIndex { get; set; }
        public int pageSize { get; set; }
    }

    /// <summary>
    /// 打印表单数据实体
    /// </summary>
    public class PrintFormDataModel 
    {
        //加工任务令
        public string? TaskOrderPO { get; set; }
        //跟踪单号
        public string? ApplicationNumber { get; set; }
        //原物料编码
        public string? RawMaterialCode { get; set; }
        //原产品型号
        public string? RawProductType { get; set; }
        //原生产厂家
        public string? RawManufacturer { get; set; }
        //新物料编码
        public string? NewMaterialCode { get; set; }
        //新产品型号
        public string? NewProductType { get; set; }
        //新生产厂家
        public string? NewManufacturer { get; set; }
        //单板/机柜编码
        public string? TrialBoardCabinetCode { get; set; }
        //单板/机柜型号
        public string? SingleBoardCabinetType { get; set; }
        //试用数量
        public string? TrialFinishedProductCount { get; set; }
        //元件位置
        public string? ElementPositioning { get; set; }
        //加工类型
        public string? ProcessingType { get; set; }
    }

}
